</head>
<body>
<div class="f-sep10"></div>
<div class="f-sep10"></div>
<div class="m-hd m-tabs">
	<h2 class="u-tt">{$action_name}专题内容</h2>
	<ul id="tabs">
		<li> <a class="z-crt" href="#tab1"><span class="icon">&#xf05a;</span> 基本信息</a></li>
	</ul>
</div>
<div class="f-sep10"></div>
<div class="m-form">
	<form action="<?php echo url('admin_list/'.$action.'_save'); ?>" method="post" id="form">
		<fieldset>
			<div class="formitm">
			  <label class="lab" >栏目：</label>
			  <div class="ipt">
				<div class="txt">
				  <select name="cid"  reg="." id="cid" msg="栏目未选择" onChange="get_fields()" >
					<option value="">======选择栏目======</option>
					<!--foreach:{$class_list $vo}-->
					<option  <?php if($info['cid']==$vo['cid']) { ?> selected="selected" <?php } ?> 
									  <?php if($vo['type']==0){ ?> value="0" style="background-color:#ccc"  disabled="disabled" <?php }else{ ?>  value="{$vo['cid']}"<?php } ?> >
									  {$vo['cname']}
					</option>
					<!--{/foreach}-->
				  </select>
				</div>
				<span class="Validform_checktip"></span> </div>
			</div>
            <?php if(!empty($recommend_list)){ ?>
            <div class="formitm">
              <label class="lab" >推荐位：</label>
              <div class="ipt"> 
                <!--foreach:{$recommend_list $vo}-->
                <input name="recommend[]" type="checkbox" value="{$vo.id}" <?php if(is_array($recommend_array)){ if(in_array($vo['id'],$recommend_array)){ ?> checked="checked" <?php }} ?> />
                {$vo.name}&nbsp;&nbsp; 
                <!--{/foreach}--> 
              </div>
            </div>
            <?php } ?>
			<div class="formitm">
				<label class="lab" >内容标题：</label>
				<div class="ipt">
					<input name="title" type="text" class="u-ipt" id="title" value="{$info.title}"  datatype="*" errormsg="内容标题未填写"  />
					<span class="Validform_checktip"></span> <a href="javascript:;" id="uptitle">更新标题</a></div>
			</div>
			<div class="formitm">
				<label class="lab" >内容顺序：</label>
				<div class="ipt">
					<input name="sequence" type="text" class="u-ipt" value="{$info.sequence isset="0"}"  datatype="n" errormsg="请输入整数！"  />
					<span class="Validform_checktip">数字越小越靠前</span> </div>
			</div>
			<div class="formitm">
				<label class="lab" >关联文章：</label>
				<div class="ipt">
					<span id="s-title">{$content_info.title}</span>
					<button class="u-btn u-btn-c4" type="button" onClick="search()">选择</button> </div>
			</div>
			<div class="formitm formitm-1">
				<button class="u-btn" id="submit" type="submit">保存修改</button>
				<button class="u-btn u-btn-c4" id="reset" type="button">重置</button>
				<span id="tip" class="load"></span> </div>
		</fieldset>
		<input name="id" type="hidden" value="{$info.id}" />
		<input name="aid" id="aid" type="hidden" value="{$info.aid}" />
	</form>
</div>
</body>
<script>
var search = new function(){}; 
Do.ready('base','form','dialog', function() {
	saveform('{$url(admin_list/index)}');
	
	search = function search(){
		urldialog({
			title:'选择内容',
			url:'{$url(admin_list/search)}',
			width:640,
			height:480
        });
	};
	
	$('#uptitle').click(function() {
		var aid = $('#aid').val();
		$.post('{$url(admin_list/uptitle)}',{aid:aid},function(json){
			if(json.status=='n'){
				$('#title').val(json.info,3);
			}else{
				$('#title').val(json.info);
				art.dialog.tips('标题已更新！', 3);
			}
			
		},'json');
	});
});
</script>